package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-25
 * Time: 20:24
 */
public class Circle  extends Shape{
    protected int r;
    public Circle(int r){
        this.r=r;
    }
    public int getR(){
        return r;
    }
    //方法的重写
    public double getArea(){
        return Math.PI*r*r;
    }
    public double getC(){
        return Math.PI*2*r;
    }

}
